//---------------------------------------------------------------------------
#ifndef hbmpH
#define hbmpH

#include <windows.h>

#pragma pack(push,1)
union SColor
{
    DWORD quad;
    struct
    {
        BYTE b;
        BYTE g;
        BYTE r;
        BYTE a;
    };
};
#pragma pack(pop)

class HBitmap
{
private:
    void *bits;
    HBITMAP hBMP;
    BITMAPINFO bi;
    HDC dc;

//    void setSize(int w, int h);

    void clear();

public:
    HBitmap(int w=0, int h=0);
    ~HBitmap();

    SColor* getScanLine(int y);
    SColor& Pixel(int x, int y);
    HDC getDC();

    void setSize(int w, int h);

    int width;
    int height;
};
//---------------------------------------------------------------------------
#endif
